package com.fc.redis.util;

import java.util.List;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

import org.apache.poi.hssf.usermodel.HSSFRow;

/**
 * @program: fc-redis->DefaultExcelBean
 * @description: 建议使用 DefaultExcelBean
 * @author: G_Y
 * @create: 2019-09-07 10:21
 **/
public final class DefaultExcelBean<T> extends ExportExcelBean<T> {

    public DefaultExcelBean(@NotBlank String fileName, @NotBlank String sheetName, @NotNull String[] tableHeader,
                            @NotEmpty List<T> rows, @NotEmpty List<String> fieldNames) {
        super(fileName, sheetName, tableHeader, rows);
        this.setFieldNames(fieldNames);
    }

    @Override
    public void writeExportExcelRow(HSSFRow row, T t) {
        super.writeExportExcelRowByFieldNames(row, t);
    }
}
